package domain;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.SortedSet;

public class PDFLibrary {
    
    /**
     * Note the private constructor. The class must implement the Singleton Pattern.
     * 
     * @param filename
     */
	private static PDFLibrary instance = null;
	
	
    private PDFLibrary(String filename) {
    	 // Supostamente: Exists only to defeat instantiation.
    	File f = new File(filename);
    }
    
    /**
     * Given a filename, returns an instance of PDFLibrary. The filename is used 
     * to save library's content.
     * @param filename
     * @return
     */
    public static PDFLibrary makePDFLibrary(String filename) {
    	if(instance == null) {
    		instance = new PDFLibrary(filename);
    	}
    	return instance;
    	   }
       
    
    /**
     * Saves the library to the disc.
     */
    public void saveLibrary() {
    }
    
    /**
     * Loads a library from the disc. 
     */
    public void loadLibrary() {
    }
    
    /**
     * Adds a document to the library.
     * @param doc
     */
    public void addDoc(PDFdoc doc) {
    }
    
    /**
     * Removes a document from the library.
     * @param doc
     */
    public void removeDoc(PDFdoc doc) {
    }
    
    /**
     * Returns the number of documents present in the library.
     * @return
     */
    public int getNumberOfDocuments() {
        return 0;
    }
    
    /**
     * Given a set of tags, select the documents that have at least 
     * one of these tags. The result is a possibly large set of documents
     * referred as the "selection". 
     * @param tags
     */
    public void selectDocsWithOneOfTheseTags(ArrayList<String> tags) {
    }
    
    /**
     * Given a set of tags, select the documents that have all the 
     * tags. The result is a possibly large set of documents
     * referred as the "selection". 
     * @param tags
     */
    public void selectDocsWithAllTheseTags(ArrayList<String> currentTags) {    
    }
    /**
     * The selection is divided into subsets of documents called "groups".
     * This method returns the first group of the selection.
     * 
     * @return
     */
    public List<PDFdoc> getFirstGroup() {
        return null; 
    }
    
    /**
     * Returns the next group of documents.
     * @return
     */
    public List<PDFdoc> getNextGroup() {
        return null; 
    }
    /**
     * Returns the previous group of documents.
     * @return
     */
    public List<PDFdoc> getPreviousGroup() {
        return null; 
    }
    
    /**
     * Changes the size (number of elements) that from a group of documents.
     * @param size
     */
    public void setGroupSize(int size) {
    }
    
    /**
     * Returns the number of the current group of documents.
     * @return
     */
    public int getCurrentGroupNumber() {
        return 0;    
    }
    
    /**
     * Returns the number of groups in the selection
     * @return
     */
    public int nbGroupsInSelection() {
        return 0; 
    }
    
    /**
     * Returns the number of elements in the selection.
     * @return
     */
    public int selectionSize() {
        return 0; 
    }
    
    public String toString() {
        return "not implemented";
    }

}
